#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++) 
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int , int >;
using vec = vector < int >;
using veg = vector < pii >;

int read() {
	int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-', ch = getchar(); 
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar(); return f ? -x : x;
}

const int N = 1.5e5 + 10;
const int mod = 998244353;

int n, m, tg[N], inv;

inline int upd(int x) { return x + (x >> 31 & mod); }
inline ll qp(ll x, int t) { ll res = 1; for(; t; t >>= 1, x = x * x % mod) if(t & 1) res = res * x % mod; return res; }

namespace T {
	int tr[N];
	inline void add(int x, int v) { for(; x <= n; x += x & -x) tr[x] = upd(tr[x] + v - mod); }
	inline int query(int x) { int res = 0; for(; x; x -= x & -x) res = upd(res + tr[x] - mod); return res; }
	inline void add(int x, int y, int v) { if(x <= y) add(x, v), add(y + 1, upd(-v)); }
}

int fa[N], top[N], siz[N], son[N], dfn[N], R[N], tim;
vec G[N];

void dfs(int x, int p) {
	fa[x] = p; siz[x] = 1; son[x] = 0;
	for(auto y : G[x]) if(y ^ p) dfs(y, x), siz[x] += siz[y], son[x] = siz[y] > siz[son[x]] ? y : son[x];
}

void dfs1(int x, int anc) {
	top[x] = anc; dfn[x] = ++tim; if(son[x]) dfs1(son[x], anc);
	for(auto y : G[x]) if(y ^ fa[x] && y ^ son[x]) dfs1(y, y);
	R[x] = tim;
}

void modify(int x, int v) {
	tg[x] = upd(tg[x] + v - mod); if(son[x]) T :: add(dfn[son[x]], R[son[x]], 1ll * (n - siz[son[x]]) * v % mod);
	if(x != 1) {
		T :: add(1, dfn[x] - 1, 1ll * siz[x] * v % mod);
		T :: add(R[x] + 1, n, 1ll * siz[x] * v % mod);
	}
}

int query(int x) {
	int res = upd(1ll * tg[x] * n % mod + T :: query(dfn[x]) - mod);
	while(x) {
		res = upd(res + 1ll * tg[fa[top[x]]] * (n - siz[top[x]]) % mod - mod);
		x = fa[top[x]];
	} return 1ll * res * inv % mod;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in", "r", stdin);
#endif
	n = in, m = in; rep(i, 2, n) { int u = in, v = in; G[u].pb(v), G[v].pb(u); }
	dfs(1, 0); dfs1(1, 1); inv = qp(n, mod - 2);
	rep(i, 1, m) {
		int op = in, u = in;
		if(op == 1) modify(u, in);
		else printf("%d\n", query(u));
	}
	return 0;
}
